

// var editor = CKEDITOR.replace('Text');
//
// function OnSave(){
// 		if(CKEDITOR.instances.Text.getData()==""){
// 		alert("内容不能为空！");
// 		return false;
// 		}else {
// 		alert (CKEDITOR.instances.Text.getData());
// 		}


let vm = new Vue({
    el: '#app1',
    data:{
        username: sessionStorage.username || localStorage.username,
        user_id: sessionStorage.user_id || localStorage.user_id,
        token: sessionStorage.token || localStorage.token,
        content_body:{},
        content:"",
        image: "",
        message:"",

    },
    mounted:function () {
        CKEDITOR.replace('editor2', { filebrowserUploadUrl:'http://127.0.0.1:8000/ckeditor/upload/' }); // shoudong shezhi fuwenben de shangchuandizhi


    },
    methods:{
        onsubmit_tsukkomi:function () {
            this.content = CKEDITOR.instances.editor_text.getData();

            console.log(this.content);
            this.content_body={"content":this.content,"user":this.user_id};
            axios.post(host + '/tsukkomis/new/',this.content_body,{
                headers:{
                    "Authorization": "JWT " + this.token
                },
                responseType:"json"
            })
                .then(response=>{
                    window.location.reload()
                })
                .catch(error =>{alert('未登录')})

        },

    }
});



var aaa = new Vue({
    el:"",
    data:{
        // 页面中需要使用到的数据，键值对
    },
    computed:{
        // 需要通过计算得到的数据，键值对 ，键是名称，值是匿名函数
    },
    mounted:function () {
        // 一加载就需要做的，直接是代码
    },
    methods:{
        // 需要用到的函数，键值对 ，键是名称，值是匿名函数
    }
})